package com.itheima.web.controller;

import com.itheima.web.manager.AnalysisManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AnalysisController {

    @Autowired
    AnalysisManager analysisManager;

    @GetMapping("/dashboard/summary")
    public ResponseEntity findSummary(){
        return analysisManager.findSummary();
    }

    //实战: 新增,活跃用户,次日留存率
    @GetMapping("/dashboard/users")
    public ResponseEntity findSummaryByTime(Integer type,Long sd,Long ed){
        return analysisManager.findSummaryByTime(type,sd,ed);
    }

    @GetMapping("/dashboard/distribution")
    public ResponseEntity analysisAll(Long sd,Long ed){
        return analysisManager.analysisAll(sd,ed);
    }
}
